using UnityEngine;
using System.Collections;

public class CamFollow : MonoBehaviour {

	public Transform player;
	Vector3 pos;
	
	void Start()
	{
		pos.x = -3.13f;
		pos.y = player.position.y + 1.58f;	
	}
	
	void Update () 
	{

			if(player.position.x > -3.6f)
			{
				pos.x = player.position.x + 0.5f;
			}
		
			if(player.position.y > 0.5f)
			{
				pos.y = player.position.y + 1.1f;	
			}
		
			transform.position = new Vector3(pos.x,pos.y,-10);
		
	}
}
